package com.indexingsystem.boss.utils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.apache.log4j.PropertyConfigurator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.indexingsystem.boss.logback.LogCvt;

public class PropertiesLoadUtils {
	private static final Logger logger = LoggerFactory.getLogger(PropertiesLoadUtils.class);
	public final static String NEWLINE = System.getProperty("line.separator","\n");
	public final static  Properties table = new Properties();

	static {
		try {
			table.load(LogCvt.class.getClassLoader().getResourceAsStream("institution.properties"));
			PropertyConfigurator.configure(table);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static String getString(String key) {
		return table.getProperty(key);
	}
	
	public static Map<String,String> getAll(){
		Map<String, String> map = new HashMap<String, String>((Map) table);
		return map;		
	}
	
	
    public static void main(String[] args) {
		System.out.println(PropertiesLoadUtils.getString("12aa1c87305f4271a90bffeb28315ca2"));
		System.out.println(PropertiesLoadUtils.getAll());
	}
}